# -*- coding: utf-8 -*-
"""
Created on Tue Apr 23 19:35:25 2019

@author: yaoyu
"""

import numpy as np

a = np.arange(100).reshape(5,20)
if 0:
    np.savetxt('a.csv', a, fmt='%d', delimiter=',')
    a.tofile('b.dat', sep=',', format='%d')
    #a.tofile('b.dat', format='%d')
    c = np.fromfile('b.dat', sep=',', dtype=np.int).reshape(5,20)
    print(c)

if 0:
    b = np.loadtxt('a.csv', delimiter=',')
    print(b)


np.save('a.npy', a)
b = np.load('a.npy')
print(b)